#include <cstdio>
#include <vm.h>

const int program[] = {
    PSH, 300,
    PSH, 6000,
    PSH, 5000,
    PSH, 7000,
    PSH, 3000,
    ADD,
    POP,
    SET, IP, -1,
    HLT
};

int main(int argc, char** argv) {
    auto* vm = new VM(program);

    while (true) {
        int nextIns = vm->fetch();
        vm->eval(nextIns);
        if (!vm->running) {
            break;
        }
    }

    return 0;
}